package com.sprouting.personal.model.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.sprouting.personal.annotations.CheckLength;
import com.sprouting.personal.annotations.CheckNotNull;
import com.sprouting.personal.model.common.BaseModel;
import com.sprouting.personal.model.common.jsr.AddGroup;
import com.sprouting.personal.model.common.jsr.UpdGroup;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;

/**
 * 网址
 *
 * @author ：LX（长沙麓谷）
 * @date 创建时间： 2022/9/10 7:54
 */
@Data
@TableName("ps_website")
public class Website extends BaseModel {

    /**
     * 主键
     */
    @TableId
    @CheckNotNull(message = "非法ID", groups = UpdGroup.class)
    @Null(message = "无效ID", groups = AddGroup.class)
    private String id;
    /**
     * 所属用户ID
     */
    @CheckNotNull(message = "请选择所属用户", groups = UpdGroup.class)
    private String userId;
    /**
     * 网址类型-id
     * @see Dict#getId()
     */
    @CheckNotNull(message = "请选择网址类型")
    private String typeId;
    /**
     * 是否要翻墙
     * @see com.sprouting.personal.interfaces.common.Constant.YesOrNo#YES 要翻墙
     */
    @NotNull(message = "请选择是否要翻墙")
    private Integer overTheWall;
    /**
     * 网站名称
     */
    @CheckNotNull(message = "请输入网站名称")
    @CheckLength(max = 200, message = "网站名称超过长度限制")
    private String name;
    /**
     * 网址
     */
    @CheckNotNull(message = "请输入网址")
    @CheckLength(max = 600, message = "网址超过长度限制")
    private String url;
    /**
     * 点击次数
     */
    private Integer numberOfClicks;
    /**
     * 是否常用
     * @see com.sprouting.personal.interfaces.common.Constant.YesOrNo#YES 常用
     */
    private Integer commonlyUsed;
    /**
     * 描述
     */
    @CheckLength(max = 1500, message = "描述信息超过长度限制")
    private String describe;

}
